<?php
/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/


Route::get('/', function () {
    return view('welcome');
});

/*这里是layui的练习 */
Route::group(['prefix' => 'layui'], function () {
    Route::get('class1', function () {
        return view('layui.class1');
    });
    Route::get('class2', function () {
        return view('layui.class2');
    });
});


//登录和退出路由
Route::group(['prefix' => 'admin'], function () {
    //后台登陆页面
    Route::get('public/login', 'Admin\PublicController@login')->name('login');
    //后台登陆处理
    Route::post('public/check', 'Admin\PublicController@check');
    //账号退出
    Route::get('public/logout', 'Admin\PublicController@logout');
    //这是ESP8266 POST请求处理路由   这是对外开放的API，不需要CSRF验证
    Route::any('info/post_reveive', 'Admin\InfoController@present');
    //这是开放给手机APP的数据接口API
    Route::get('public/appdate', 'Admin\InfoController@appdate');
});



//后台部分（需要鉴权判断）
Route::group(['prefix' => 'admin', 'middleware' => ['auth:admin', 'checkrbac']], function () {


    //后台首页界面
    Route::get('index/index', 'Admin\IndexController@index');
    Route::get('index/welcome', 'Admin\IndexController@welcome');
    Route::get('index/info', 'Admin\IndexController@info');
    Route::get('index/dashboard', 'Admin\IndexController@dashboard');



    //管理员的管理模块
    Route::any('manager/lst', 'Admin\ManagerController@lst'); //列表
    Route::any('manager/add', 'Admin\ManagerController@add'); //添加
    Route::post('manager/del', 'Admin\ManagerController@del'); //删除
    Route::any('manager/edit/{id}', 'Admin\ManagerController@edit'); //编辑



    //权限的管理模块
    Route::any('auth/lst', 'Admin\AuthController@lst'); //列表
    Route::any('auth/add', 'Admin\AuthController@add'); //添加
    Route::post('auth/del', 'Admin\AuthController@del'); //删除
    Route::any('auth/edit/{id}', 'Admin\AuthController@edit'); //编辑

    Route::get('auth/snake', 'Admin\AuthController@snake'); //权限分类 (贪吃蛇)


    //角色的管理模块
    Route::any('role/lst', 'Admin\RoleController@lst'); //列表
    Route::any('role/add', 'Admin\RoleController@add'); //添加
    Route::post('role/del', 'Admin\RoleController@del'); //删除
    Route::any('role/edit/{id}', 'Admin\RoleController@edit'); //编辑

    //系统信息采集的展示模块
    Route::any('info/index', 'Admin\InfoController@index'); //服务导航
//admin/info/index

    Route::any('info/house', 'Admin\InfoController@house'); //温湿度展示


    Route::any('info/MQ2', 'Admin\InfoController@MQ2'); //易燃气体展示

    Route::any('info/present_get_TA', 'Admin\InfoController@present_get_TA'); //温湿度仪表盘的实时温湿度
    Route::any('info/present_get_MQ2', 'Admin\InfoController@present_get_MQ2'); //温湿度仪表盘的实时温湿度
    Route::any('info/mail', 'Admin\InfoController@mail'); //信息订阅服务
    Route::get('info/Unrealized', 'Admin\InfoController@Unrealized');



    //家庭防护模块
    Route::any('house/lst', 'Admin\HouseController@lst'); //家庭成员列表
    // intrusion:入侵
    Route::any('house/intrusion', 'Admin\HouseController@intrusion'); //入侵视频展示
    Route::any('house/add', 'Admin\HouseController@add'); //增加
    Route::any('house/fileupload', 'Admin\HouseController@fileupload'); //增加
    Route::post('house/del', 'Admin\HouseController@del'); //删除
    // Route::any('manager/edit/{id}', 'Admin\HouseController@edit'); //编辑


});
